<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改班级信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-classInfo-edit" th:object="${classInfo}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">班级名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">班级描述：</label>
                <div class="col-sm-8">
                    <textarea name="introduce" class="form-control">[[*{introduce}]]</textarea>
                </div>
            </div>
           <!--  <div class="form-group">    
                <label class="col-sm-3 control-label">辅导员编号：</label>
                <div class="col-sm-8">
                    <input name="teacherId" th:field="*{teacherId}" class="form-control" type="text">
                </div>
            </div> -->
            <div class="form-group">    
                <label class="col-sm-3 control-label">班级辅导员老师：</label>
                <div class="col-sm-8">
                     <!--督导员编号   -->            
                    <input name="teacherName" th:field="*{teacherName}" class="form-control" type="hidden" id="teacherName" > 
                    <select class="form-control m-b" name="teacherId" id="teacherId">                  
                       <option th:each="teacher : ${teachers}" th:text="${teacher.name}" th:value="${teacher.id}" th:selected="*{teacherId}==${teacher.id}" ></option>
                    </select>   
                </div>
            </div>           
            <div class="form-group">    
                <label class="col-sm-3 control-label">班级状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box">                        
                        <select name="status" class="form-control m-b" th:with="type=${@dict.getType('wct_class_staus')}">                                  
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="*{status}==${dict.dictValue}"></option>
                       </select>
                    </div>                    
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "course/classInfo";
        $("#form-classInfo-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
            	$("#teacherName").val($("#teacherId").find("option:selected").text());
                $.operate.save(prefix + "/edit", $('#form-classInfo-edit').serialize());
            }
        }
    </script>
</body>
</html>